feat(enforcement): add Smart Enforcement system for improved code quality#15
Merged
victormartingil merged 2 commits intomainfrom Jan 28, 2026
Merged
feat(enforcement): add Smart Enforcement system for improved code quality#15victormartingil merged 2 commits intomainfrom
victormartingil merged 2 commits intomainfrom
Conversation
…lity Smart Enforcement upgrades Corbat from advisory mode to enforcing mode by introducing a mandatory quality gate before code is shown to the user. New tool: - verify: quality gate that must PASS before presenting code to the user Enhanced tools: - validate: performs real code analysis with 15+ detected anti-patterns - get_context: includes checkpoint, response format, and self-review New module: - src/analysis/code-analyzer.ts: lightweight regex-based code analyzer Testing: - add 52 tests (37 for analyzer, 15 for verify) - maintain coverage at 82.62% Token impact: ~500–700 additional tokens per interaction Expected quality improvement: +25–30% BREAKING CHANGE: validate tool output format changed.
- Refactor assignment-in-while expressions (separate initialization) - Remove unused `task_type` variable from verify handler - Fix unnecessary escape in Python regex pattern - Auto-fix import organization (alphabetical ordering) All 226 tests pass with 82.62% coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a Smart Enforcement system that transforms Corbat from advisory to enforcing mode.
Problem
The current MCP provides guidelines, but LLMs can ignore them without consequences.
Solution
Five complementary strategies that force LLMs to follow standards:
Changes
Test Plan